﻿@model LecturerPracticeListViewModel
@using DiplomaWeb.Models.CompaniesAndLecturers

<script type="text/javascript" language="javascript">
    function DeleteLecturerPractice(lecturerId) {
        var path = '@Url.RouteUrl("Default", new {controller = "SystemManagers", action = "DeleteLecturerPractice"})';
        $.ajax({
            url: path,
            type: "POST",
            async: false,
            data: ({ lecturerId: lecturerId }),
            success: function () {
                $("#" + lecturerId).remove();
            }
        });
    }

    function GetLecturerPracticeDetails(lecturerId) {
        var path = '@Url.RouteUrl("Default", new {controller = "SystemManagers", action = "GetLecturerPracticeDetails"})';
        $.ajax({
            url: path,
            type: "POST",
            async: false,
            data: ({ lecturerId: lecturerId }),
            success: function (response) {
                $("#propertiesList").html(response);
            }
        });
    }
</script>
@foreach (var item in Model.Lecturers) {
    <div id="@item.Id">
        <img src="@Url.Content("~/Content/Icons/delete.png")" class="mediumIcon" onclick="DeleteLecturerPractice('@item.Id');" />
        <img src="@Url.Content("~/Content/Icons/edit.png")" class="mediumIcon" onclick="GetLecturerPracticeDetails('@item.Id');" /> 
        <span class="mediumBoldText">
            @item.FIO
        </span>
    </div>
}